<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			//---------------------一次--------------------------------------------
			// iTimerID = window.setTimeout(vCode, iMilliSeconds [, sLanguage])

			var id1 = setTimeout(function() {
				// console.log("abc1");
			}, 3000);

			var id2 = setTimeout(function() {
				// console.log("abc2");
			}, 3000);

			window.onload = function() {
				var button = document.querySelector('button');
				button.addEventListener('click', function() {
					// clearTimeout(id1);
					clearInterval(id3);
				})
			}

			//---------------------多次--------------------------------------------
			/* var id3 = setInterval(function() {
				console.log("学掌门");
			}, 3000); */


			//-------------------------------------------------------------------
			/*
			   页面加载事件:
			   1.load:页面中全部内容加载显示完毕后触发
			   2.DOMContentLoaded: DOM对象生成后触发
			
			*/
			window.onload = function() {
				console.log("123");
			}

			window.addEventListener('load', function() {
				console.log("abc");
			})

			window.addEventListener('DOMContentLoaded', function() {
				// console.log("DOMContentLoaded");
				var button = document.querySelectorAll('button')[1];
				button.addEventListener('click', function() {
					// window.open('https://www.atstudy.com/');
					window.open('练习1.html');
				})
			})
			//-----------------------open()------------------------------------------------
			
			window.console;
			window.document.querySelector('')
		</script>
	</head>
	<body>
		<button>取消定时</button>
		<button>打开窗口</button>
	</body>
</html>
